/********************************************************************************
 * FeesManagerAction.java
 *
 * Created by Jigar Mistry
 * Last modified Date: Sep 9, 2008 4:31:14 PM by Jigar Mistry
 * Version : 0.1
 * Copyright (c) 2008 - 2009 cyberThink Infotech Pvt. Ltd., All rights reserved.
 ********************************************************************************/
package com.printeverywhere.action;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;

import com.printeverywhere.delegator.AdditionalCategoriesServiceDelegator;
import com.printeverywhere.delegator.AdditionalOptionsFeesServiceDelegator;
import com.printeverywhere.delegator.AuctionListingFeesServiceDelegator;
import com.printeverywhere.delegator.BannersImpressionsServiceDelegator;
import com.printeverywhere.delegator.DurationDiscountServiceDelegator;
import com.printeverywhere.delegator.FinalFeesServiceDelegator;
import com.printeverywhere.delegator.MiscellaneousFeesServiceDelegator;
import com.printeverywhere.delegator.ReserveAuctionListingFeesServiceDelegator;
import com.printeverywhere.dto.AdditionalCategories;
import com.printeverywhere.dto.AdditionalOptionsFees;
import com.printeverywhere.dto.AuctionListingFees;
import com.printeverywhere.dto.BannersImpressions;
import com.printeverywhere.dto.DurationDiscount;
import com.printeverywhere.dto.FinalFees;
import com.printeverywhere.dto.MiscellaneousFees;
import com.printeverywhere.dto.ReserveAuctionsListingFees;

/**
 * The Class FeesManagerAction.
 */
public class FeesManagerAction extends AdminSystemManagement {

	/** Logger for this class. */
	private static final Logger logger = Logger.getLogger(FeesManagerAction.class);

	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = 1L;

	/** The auction listing fees. */
	private AuctionListingFees auctionListingFees;

	/** The auction listing fees list. */
	private List<AuctionListingFees> auctionListingFeesList;

	/** The auction listing fees map. */
	private Map<Integer, AuctionListingFees> auctionListingFeesMap;

	/** The reserve auction listing fees. */
	private ReserveAuctionsListingFees reserveAuctionListingFees;

	/** The reserve auction listing fees list. */
	private List<ReserveAuctionsListingFees> reserveAuctionListingFeesList;

	/** The reserve auction listing fees map. */
	private Map<Integer, ReserveAuctionsListingFees> reserveAuctionListingFeesMap;

	/** The final fees. */
	private FinalFees finalFees;

	/** The final fees list. */
	private List<FinalFees> finalFeesList;

	/** The final fees map. */
	private Map<Integer, FinalFees> finalFeesMap;

	/** The additional categories. */
	private AdditionalCategories additionalCategories;

	/** The additional categories list. */
	private List<AdditionalCategories> additionalCategoriesList;

	/** The additional categories map. */
	private Map<Integer, AdditionalCategories> additionalCategoriesMap;

	/** The duration discount. */
	private DurationDiscount durationDiscount;

	/** The duration discount list. */
	private List<DurationDiscount> durationDiscountList;

	/** The duration discount map. */
	private Map<Integer, DurationDiscount> durationDiscountMap;

	/** The banners impressions. */
	private BannersImpressions bannersImpressions;

	/** The banners impressions list. */
	private List<BannersImpressions> bannersImpressionsList;

	/** The banners impressions map. */
	private Map<Integer, BannersImpressions> bannersImpressionsMap;

	/** The additional options fees. */
	private AdditionalOptionsFees additionalOptionsFees;

	/** The additional options fees list. */
	private List<AdditionalOptionsFees> additionalOptionsFeesList;

	/** The additional options fees map. */
	private Map<Integer, AdditionalOptionsFees> additionalOptionsFeesMap;

	/** The miscellaneous fees. */
	private MiscellaneousFees miscellaneousFees;

	/**
	 * Gets the auction listing fees.
	 *
	 * @return the auction listing fees
	 */
	public AuctionListingFees getAuctionListingFees() {
		return auctionListingFees;
	}

	/**
	 * Sets the auction listing fees.
	 *
	 * @param auctionListingFees the new auction listing fees
	 */
	public void setAuctionListingFees(AuctionListingFees auctionListingFees) {
		this.auctionListingFees = auctionListingFees;
	}

	/**
	 * Gets the auction listing fees map.
	 *
	 * @return the auction listing fees map
	 */
	public Map<Integer, AuctionListingFees> getAuctionListingFeesMap() {
		return auctionListingFeesMap;
	}

	/**
	 * Sets the auction listing fees map.
	 *
	 * @param auctionListingFeesMap the auction listing fees map
	 */
	public void setAuctionListingFeesMap(
			Map<Integer, AuctionListingFees> auctionListingFeesMap) {
		this.auctionListingFeesMap = auctionListingFeesMap;
	}

	/**
	 * Gets the auction listing fees list.
	 *
	 * @return the auction listing fees list
	 */
	public List<AuctionListingFees> getAuctionListingFeesList() {
		return auctionListingFeesList;
	}

	/**
	 * Sets the auction listing fees list.
	 *
	 * @param auctionListingFeesList the new auction listing fees list
	 */
	public void setAuctionListingFeesList(
			List<AuctionListingFees> auctionListingFeesList) {
		this.auctionListingFeesList = auctionListingFeesList;
	}

	/**
	 * Gets the reserve auction listing fees.
	 *
	 * @return the reserve auction listing fees
	 */
	public ReserveAuctionsListingFees getReserveAuctionListingFees() {
		return reserveAuctionListingFees;
	}

	/**
	 * Sets the reserve auction listing fees.
	 *
	 * @param reserveAuctionListingFees the new reserve auction listing fees
	 */
	public void setReserveAuctionListingFees(
			ReserveAuctionsListingFees reserveAuctionListingFees) {
		this.reserveAuctionListingFees = reserveAuctionListingFees;
	}

	/**
	 * Gets the reserve auction listing fees list.
	 *
	 * @return the reserve auction listing fees list
	 */
	public List<ReserveAuctionsListingFees> getReserveAuctionListingFeesList() {
		return reserveAuctionListingFeesList;
	}

	/**
	 * Sets the reserve auction listing fees list.
	 *
	 * @param reserveAuctionListingFeesList the new reserve auction listing fees list
	 */
	public void setReserveAuctionListingFeesList(
			List<ReserveAuctionsListingFees> reserveAuctionListingFeesList) {
		this.reserveAuctionListingFeesList = reserveAuctionListingFeesList;
	}

	/**
	 * Gets the reserve auction listing fees map.
	 *
	 * @return the reserve auction listing fees map
	 */
	public Map<Integer, ReserveAuctionsListingFees> getReserveAuctionListingFeesMap() {
		return reserveAuctionListingFeesMap;
	}

	/**
	 * Sets the reserve auction listing fees map.
	 *
	 * @param reserveAuctionListingFeesMap the reserve auction listing fees map
	 */
	public void setReserveAuctionListingFeesMap(
			Map<Integer, ReserveAuctionsListingFees> reserveAuctionListingFeesMap) {
		this.reserveAuctionListingFeesMap = reserveAuctionListingFeesMap;
	}

	/**
	 * Gets the final fees.
	 *
	 * @return the final fees
	 */
	public FinalFees getFinalFees() {
		return finalFees;
	}

	/**
	 * Sets the final fees.
	 *
	 * @param finalFees the new final fees
	 */
	public void setFinalFees(FinalFees finalFees) {
		this.finalFees = finalFees;
	}

	/**
	 * Gets the final fees list.
	 *
	 * @return the final fees list
	 */
	public List<FinalFees> getFinalFeesList() {
		return finalFeesList;
	}

	/**
	 * Sets the final fees list.
	 *
	 * @param finalFeesList the new final fees list
	 */
	public void setFinalFeesList(List<FinalFees> finalFeesList) {
		this.finalFeesList = finalFeesList;
	}

	/**
	 * Gets the final fees map.
	 *
	 * @return the final fees map
	 */
	public Map<Integer, FinalFees> getFinalFeesMap() {
		return finalFeesMap;
	}

	/**
	 * Sets the final fees map.
	 *
	 * @param finalFeesMap the final fees map
	 */
	public void setFinalFeesMap(Map<Integer, FinalFees> finalFeesMap) {
		this.finalFeesMap = finalFeesMap;
	}

	/**
	 * Gets the additional categories.
	 *
	 * @return the additional categories
	 */
	public AdditionalCategories getAdditionalCategories() {
		return additionalCategories;
	}

	/**
	 * Sets the additional categories.
	 *
	 * @param additionalCategories the new additional categories
	 */
	public void setAdditionalCategories(AdditionalCategories additionalCategories) {
		this.additionalCategories = additionalCategories;
	}

	/**
	 * Gets the additional categories list.
	 *
	 * @return the additional categories list
	 */
	public List<AdditionalCategories> getAdditionalCategoriesList() {
		return additionalCategoriesList;
	}

	/**
	 * Sets the additional categories list.
	 *
	 * @param additionalCategoriesList the new additional categories list
	 */
	public void setAdditionalCategoriesList(
			List<AdditionalCategories> additionalCategoriesList) {
		this.additionalCategoriesList = additionalCategoriesList;
	}

	/**
	 * Gets the additional categories map.
	 *
	 * @return the additional categories map
	 */
	public Map<Integer, AdditionalCategories> getAdditionalCategoriesMap() {
		return additionalCategoriesMap;
	}

	/**
	 * Sets the additional categories map.
	 *
	 * @param additionalCategoriesMap the additional categories map
	 */
	public void setAdditionalCategoriesMap(
			Map<Integer, AdditionalCategories> additionalCategoriesMap) {
		this.additionalCategoriesMap = additionalCategoriesMap;
	}

	/**
	 * Gets the duration discount.
	 *
	 * @return the duration discount
	 */
	public DurationDiscount getDurationDiscount() {
		return durationDiscount;
	}

	/**
	 * Sets the duration discount.
	 *
	 * @param durationDiscount the new duration discount
	 */
	public void setDurationDiscount(DurationDiscount durationDiscount) {
		this.durationDiscount = durationDiscount;
	}

	/**
	 * Gets the duration discount list.
	 *
	 * @return the duration discount list
	 */
	public List<DurationDiscount> getDurationDiscountList() {
		return durationDiscountList;
	}

	/**
	 * Sets the duration discount list.
	 *
	 * @param durationDiscountList the new duration discount list
	 */
	public void setDurationDiscountList(List<DurationDiscount> durationDiscountList) {
		this.durationDiscountList = durationDiscountList;
	}

	/**
	 * Gets the duration discount map.
	 *
	 * @return the duration discount map
	 */
	public Map<Integer, DurationDiscount> getDurationDiscountMap() {
		return durationDiscountMap;
	}

	/**
	 * Sets the duration discount map.
	 *
	 * @param durationDiscountMap the duration discount map
	 */
	public void setDurationDiscountMap(
			Map<Integer, DurationDiscount> durationDiscountMap) {
		this.durationDiscountMap = durationDiscountMap;
	}

	/**
	 * Gets the banners impressions.
	 *
	 * @return the banners impressions
	 */
	public BannersImpressions getBannersImpressions() {
		return bannersImpressions;
	}

	/**
	 * Sets the banners impressions.
	 *
	 * @param bannersImpressions the new banners impressions
	 */
	public void setBannersImpressions(BannersImpressions bannersImpressions) {
		this.bannersImpressions = bannersImpressions;
	}

	/**
	 * Gets the banners impressions list.
	 *
	 * @return the banners impressions list
	 */
	public List<BannersImpressions> getBannersImpressionsList() {
		return bannersImpressionsList;
	}

	/**
	 * Sets the banners impressions list.
	 *
	 * @param bannersImpressionsList the new banners impressions list
	 */
	public void setBannersImpressionsList(
			List<BannersImpressions> bannersImpressionsList) {
		this.bannersImpressionsList = bannersImpressionsList;
	}

	/**
	 * Gets the banners impressions map.
	 *
	 * @return the banners impressions map
	 */
	public Map<Integer, BannersImpressions> getBannersImpressionsMap() {
		return bannersImpressionsMap;
	}

	/**
	 * Sets the banners impressions map.
	 *
	 * @param bannersImpressionsMap the banners impressions map
	 */
	public void setBannersImpressionsMap(
			Map<Integer, BannersImpressions> bannersImpressionsMap) {
		this.bannersImpressionsMap = bannersImpressionsMap;
	}

	/**
	 * Gets the additional options fees.
	 *
	 * @return the additional options fees
	 */
	public AdditionalOptionsFees getAdditionalOptionsFees() {
		return additionalOptionsFees;
	}

	/**
	 * Sets the additional options fees.
	 *
	 * @param additionalOptionsFees the new additional options fees
	 */
	public void setAdditionalOptionsFees(AdditionalOptionsFees additionalOptionsFees) {
		this.additionalOptionsFees = additionalOptionsFees;
	}

	/**
	 * Gets the additional options fees list.
	 *
	 * @return the additional options fees list
	 */
	public List<AdditionalOptionsFees> getAdditionalOptionsFeesList() {
		return additionalOptionsFeesList;
	}

	/**
	 * Sets the additional options fees list.
	 *
	 * @param additionalOptionsFeesList the new additional options fees list
	 */
	public void setAdditionalOptionsFeesList(
			List<AdditionalOptionsFees> additionalOptionsFeesList) {
		this.additionalOptionsFeesList = additionalOptionsFeesList;
	}

	/**
	 * Gets the additional options fees map.
	 *
	 * @return the additional options fees map
	 */
	public Map<Integer, AdditionalOptionsFees> getAdditionalOptionsFeesMap() {
		return additionalOptionsFeesMap;
	}

	/**
	 * Sets the additional options fees map.
	 *
	 * @param additionalOptionsFeesMap the additional options fees map
	 */
	public void setAdditionalOptionsFeesMap(
			Map<Integer, AdditionalOptionsFees> additionalOptionsFeesMap) {
		this.additionalOptionsFeesMap = additionalOptionsFeesMap;
	}

	/**
	 * Gets the miscellaneous fees.
	 *
	 * @return the miscellaneous fees
	 */
	public MiscellaneousFees getMiscellaneousFees() {
		return miscellaneousFees;
	}

	/**
	 * Sets the miscellaneous fees.
	 *
	 * @param miscellaneousFees the new miscellaneous fees
	 */
	public void setMiscellaneousFees(MiscellaneousFees miscellaneousFees) {
		this.miscellaneousFees = miscellaneousFees;
	}

	/* (non-Javadoc)
	 * @see com.opensymphony.xwork2.ActionSupport#execute()
	 */
	public String execute() throws Exception{
		if (logger.isDebugEnabled()) {
			logger.debug("execute() - start"); //$NON-NLS-1$
		}

		if (logger.isDebugEnabled()) {
			logger.debug("execute() - end"); //$NON-NLS-1$
		}
		return SUCCESS;
	}

	/**
	 * Show regular insertion fees.
	 *
	 * @return the string
	 *
	 * @throws Exception the exception
	 */
	public String showRegularInsertionFees() throws Exception{
		if (logger.isDebugEnabled()) {
			logger.debug("showRegularInsertionFees() - start"); //$NON-NLS-1$
		}

		this.miscellaneousFees = MiscellaneousFeesServiceDelegator.getMiscellaneousFees();
		this.auctionListingFeesMap = new HashMap<Integer, AuctionListingFees>();
		this.auctionListingFeesList = AuctionListingFeesServiceDelegator.getAuctionListingFees();

		for (AuctionListingFees auctionListingFee : this.auctionListingFeesList) {
			this.auctionListingFeesMap.put(auctionListingFee.getId(), auctionListingFee);
		}

		if (logger.isDebugEnabled()) {
			logger.debug("showRegularInsertionFees() - end"); //$NON-NLS-1$
		}
		return SUCCESS;
	}

	/**
	 * Update regular insertion fees.
	 *
	 * @return the string
	 *
	 * @throws Exception the exception
	 */
	public String updateRegularInsertionFees() throws Exception{
		if (logger.isDebugEnabled()) {
			logger.debug("updateRegularInsertionFees() - start"); //$NON-NLS-1$
		}

		MiscellaneousFees tmpMiscellaneousFees = MiscellaneousFeesServiceDelegator.getMiscellaneousFees();
		this.miscellaneousFees.setFeaturedShopFee(tmpMiscellaneousFees.getFeaturedShopFee());
		MiscellaneousFeesServiceDelegator.updateMiscellaneousFees(this.miscellaneousFees);

		for (AuctionListingFees auctionListingFee : this.auctionListingFeesMap.values()) {
			AuctionListingFeesServiceDelegator.updateAuctionListingFees(auctionListingFee);
		}

		if (logger.isDebugEnabled()) {
			logger.debug("updateRegularInsertionFees() - end"); //$NON-NLS-1$
		}
		return SUCCESS;
	}

	/**
	 * Show reserve fees.
	 *
	 * @return the string
	 *
	 * @throws Exception the exception
	 */
	public String showReserveFees() throws Exception{
		if (logger.isDebugEnabled()) {
			logger.debug("showReserveFees() - start"); //$NON-NLS-1$
		}

		this.reserveAuctionListingFeesMap = new HashMap<Integer, ReserveAuctionsListingFees>();
		this.reserveAuctionListingFeesList = ReserveAuctionListingFeesServiceDelegator.getReserveAuctionListingFees();

		for (ReserveAuctionsListingFees reserveAuctionListingFee : this.reserveAuctionListingFeesList) {
			this.reserveAuctionListingFeesMap.put(reserveAuctionListingFee.getId(), reserveAuctionListingFee);
		}

		if (logger.isDebugEnabled()) {
			logger.debug("showReserveFees() - end"); //$NON-NLS-1$
		}
		return SUCCESS;
	}

	/**
	 * Update reserve fees.
	 *
	 * @return the string
	 *
	 * @throws Exception the exception
	 */
	public String updateReserveFees() throws Exception{
		if (logger.isDebugEnabled()) {
			logger.debug("updateReserveFees() - start"); //$NON-NLS-1$
		}

		for (ReserveAuctionsListingFees reserveAuctionListingFee : this.reserveAuctionListingFeesMap.values()) {
			ReserveAuctionListingFeesServiceDelegator.updateReserveAuctionListingFees(reserveAuctionListingFee);
		}

		if (logger.isDebugEnabled()) {
			logger.debug("updateReserveFees() - end"); //$NON-NLS-1$
		}
		return SUCCESS;
	}

	/**
	 * Show final fees.
	 *
	 * @return the string
	 *
	 * @throws Exception the exception
	 */
	public String showFinalFees() throws Exception{
		if (logger.isDebugEnabled()) {
			logger.debug("showFinalFees() - start"); //$NON-NLS-1$
		}

		this.finalFeesMap = new HashMap<Integer, FinalFees>();
		this.finalFeesList = FinalFeesServiceDelegator.getFinalFees();

		for (FinalFees finalFees : this.finalFeesList) {
			this.finalFeesMap.put(finalFees.getId(), finalFees);
		}

		if (logger.isDebugEnabled()) {
			logger.debug("showFinalFees() - end"); //$NON-NLS-1$
		}
		return SUCCESS;
	}

	/**
	 * Update final fees.
	 *
	 * @return the string
	 *
	 * @throws Exception the exception
	 */
	public String updateFinalFees() throws Exception{
		if (logger.isDebugEnabled()) {
			logger.debug("updateFinalFees() - start"); //$NON-NLS-1$
		}

		for (FinalFees finalFees : this.finalFeesMap.values()) {
			FinalFeesServiceDelegator.updateFinalFees(finalFees);
		}

		if (logger.isDebugEnabled()) {
			logger.debug("updateFinalFees() - end"); //$NON-NLS-1$
		}
		return SUCCESS;
	}

	/**
	 * Show optional fees.
	 *
	 * @return the string
	 *
	 * @throws Exception the exception
	 */
	public String showOptionalFees() throws Exception{
		if (logger.isDebugEnabled()) {
			logger.debug("showOptionalFees() - start"); //$NON-NLS-1$
		}

		this.additionalOptionsFeesMap = new HashMap<Integer, AdditionalOptionsFees>();
		this.additionalOptionsFeesList = AdditionalOptionsFeesServiceDelegator.getAdditionalOptionsFees();

		for (AdditionalOptionsFees additionalOptionsFees : this.additionalOptionsFeesList) {
			this.additionalOptionsFeesMap.put(additionalOptionsFees.getId(), additionalOptionsFees);
		}

		if (logger.isDebugEnabled()) {
			logger.debug("showOptionalFees() - end"); //$NON-NLS-1$
		}
		return SUCCESS;
	}

	/**
	 * Update optional fees.
	 *
	 * @return the string
	 *
	 * @throws Exception the exception
	 */
	public String updateOptionalFees() throws Exception{
		if (logger.isDebugEnabled()) {
			logger.debug("updateOptionalFees() - start"); //$NON-NLS-1$
		}

		for (AdditionalOptionsFees additionalOptionsFees : this.additionalOptionsFeesMap.values()) {
			AdditionalOptionsFeesServiceDelegator.updateAdditionalOptionsFees(additionalOptionsFees);
		}

		if (logger.isDebugEnabled()) {
			logger.debug("updateOptionalFees() - end"); //$NON-NLS-1$
		}
		return SUCCESS;
	}

	/**
	 * Show additional categories.
	 *
	 * @return the string
	 *
	 * @throws Exception the exception
	 */
	public String showAdditionalCategories() throws Exception{
		if (logger.isDebugEnabled()) {
			logger.debug("showAdditionalCategories() - start"); //$NON-NLS-1$
		}

		this.additionalCategoriesMap = new HashMap<Integer, AdditionalCategories>();
		this.additionalCategoriesList = AdditionalCategoriesServiceDelegator.getAdditionalCategories();

		for (AdditionalCategories additionalCategories : this.additionalCategoriesList) {
			this.additionalCategoriesMap.put(additionalCategories.getId(), additionalCategories);
		}

		if (logger.isDebugEnabled()) {
			logger.debug("showAdditionalCategories() - end"); //$NON-NLS-1$
		}
		return SUCCESS;
	}

	/**
	 * Update additional categories.
	 *
	 * @return the string
	 *
	 * @throws Exception the exception
	 */
	public String updateAdditionalCategories() throws Exception{
		if (logger.isDebugEnabled()) {
			logger.debug("updateAdditionalCategories() - start"); //$NON-NLS-1$
		}

		for (AdditionalCategories additionalCategories : this.additionalCategoriesMap.values()) {
			AdditionalCategoriesServiceDelegator.updateAdditionalCategories(additionalCategories);
		}

		if (logger.isDebugEnabled()) {
			logger.debug("updateAdditionalCategories() - end"); //$NON-NLS-1$
		}
		return SUCCESS;
	}

	/**
	 * Show duration discount.
	 *
	 * @return the string
	 *
	 * @throws Exception the exception
	 */
	public String showDurationDiscount() throws Exception{
		if (logger.isDebugEnabled()) {
			logger.debug("showDurationDiscount() - start"); //$NON-NLS-1$
		}

		this.durationDiscountMap = new HashMap<Integer, DurationDiscount>();
		this.durationDiscountList = DurationDiscountServiceDelegator.getDurationDiscount();

		for (DurationDiscount durationDiscount : this.durationDiscountList) {
			this.durationDiscountMap.put(durationDiscount.getId(), durationDiscount);
		}

		if (logger.isDebugEnabled()) {
			logger.debug("showDurationDiscount() - end"); //$NON-NLS-1$
		}
		return SUCCESS;
	}

	/**
	 * Update duration discount.
	 *
	 * @return the string
	 *
	 * @throws Exception the exception
	 */
	public String updateDurationDiscount() throws Exception{
		if (logger.isDebugEnabled()) {
			logger.debug("updateDurationDiscount() - start"); //$NON-NLS-1$
		}

		for (DurationDiscount durationDiscount : this.durationDiscountMap.values()) {
			DurationDiscountServiceDelegator.updateDurationDiscount(durationDiscount);
		}

		if (logger.isDebugEnabled()) {
			logger.debug("updateDurationDiscount() - end"); //$NON-NLS-1$
		}
		return SUCCESS;
	}

	/**
	 * Show banners fees.
	 *
	 * @return the string
	 *
	 * @throws Exception the exception
	 */
	public String showBannersFees() throws Exception{
		if (logger.isDebugEnabled()) {
			logger.debug("showBannersFees() - start"); //$NON-NLS-1$
		}

		this.bannersImpressionsMap = new HashMap<Integer, BannersImpressions>();
		this.bannersImpressionsList = BannersImpressionsServiceDelegator.getBannersImpressions();

		for (BannersImpressions bannersImpressions : this.bannersImpressionsList) {
			this.bannersImpressionsMap.put(bannersImpressions.getId(), bannersImpressions);
		}

		if (logger.isDebugEnabled()) {
			logger.debug("showBannersFees() - end"); //$NON-NLS-1$
		}
		return SUCCESS;
	}

	/**
	 * Update banners fees.
	 *
	 * @return the string
	 *
	 * @throws Exception the exception
	 */
	public String updateBannersFees() throws Exception{
		if (logger.isDebugEnabled()) {
			logger.debug("updateBannersFees() - start"); //$NON-NLS-1$
		}

		for (BannersImpressions bannersImpressions : this.bannersImpressionsMap.values()) {
			BannersImpressionsServiceDelegator.updateBannersImpressions(bannersImpressions);
		}

		if (logger.isDebugEnabled()) {
			logger.debug("updateBannersFees() - end"); //$NON-NLS-1$
		}
		return SUCCESS;
	}

	/**
	 * Show shops fees.
	 *
	 * @return the string
	 *
	 * @throws Exception the exception
	 */
	public String showShopsFees() throws Exception{
		if (logger.isDebugEnabled()) {
			logger.debug("showShopsFees() - start"); //$NON-NLS-1$
		}

		this.miscellaneousFees = MiscellaneousFeesServiceDelegator.getMiscellaneousFees();

		if (logger.isDebugEnabled()) {
			logger.debug("showShopsFees() - end"); //$NON-NLS-1$
		}
		return SUCCESS;
	}

	/**
	 * Update shops fees.
	 *
	 * @return the string
	 *
	 * @throws Exception the exception
	 */
	public String updateShopsFees() throws Exception{
		if (logger.isDebugEnabled()) {
			logger.debug("updateShopsFees() - start"); //$NON-NLS-1$
		}

		MiscellaneousFees tmpMiscellaneousFees = MiscellaneousFeesServiceDelegator.getMiscellaneousFees();
		tmpMiscellaneousFees.setFeaturedShopFee(this.miscellaneousFees.getFeaturedShopFee());
		MiscellaneousFeesServiceDelegator.updateMiscellaneousFees(tmpMiscellaneousFees);

		if (logger.isDebugEnabled()) {
			logger.debug("updateShopsFees() - end"); //$NON-NLS-1$
		}
		return SUCCESS;
	}

	/**
	 * Show Search Engine Fees.
	 *
	 * @return the string
	 *
	 * @throws Exception the exception
	 */
	public String showSearchEngineFees() throws Exception{
		if (logger.isDebugEnabled()) {
			logger.debug("showSearchEngineFees() - start"); //$NON-NLS-1$
		}

		this.miscellaneousFees = MiscellaneousFeesServiceDelegator.getMiscellaneousFees();

		if (logger.isDebugEnabled()) {
			logger.debug("showSearchEngineFees() - end"); //$NON-NLS-1$
		}
		return SUCCESS;
	}
	/**
	 * Update Search Engine Fees.
	 *
	 * @return the string
	 *
	 * @throws Exception the exception
	 */
	public String updateSearchEngineFees() throws Exception{
		if (logger.isDebugEnabled()) {
			logger.debug("updateShopsFees() - start"); //$NON-NLS-1$
		}

		MiscellaneousFees tmpMiscellaneousFees = MiscellaneousFeesServiceDelegator.getMiscellaneousFees();
		tmpMiscellaneousFees.setSearchEngineMonthlyFees(this.miscellaneousFees.getSearchEngineMonthlyFees());
		MiscellaneousFeesServiceDelegator.updateMiscellaneousFees(tmpMiscellaneousFees);

		if (logger.isDebugEnabled()) {
			logger.debug("updateShopsFees() - end"); //$NON-NLS-1$
		}
		return SUCCESS;
	}
}